package com.facebook.imagepipeline.animated.base;

import android.graphics.Bitmap;
import com.facebook.common.internal.Preconditions;
import com.facebook.common.references.CloseableReference;
import java.util.List;
import javax.annotation.Nullable;

public class AnimatedImageResult
{

  @Nullable
  private List<CloseableReference<Bitmap>> mDecodedFrames;
  private final int mFrameForPreview;
  private final AnimatedImage mImage;

  @Nullable
  private CloseableReference<Bitmap> mPreviewBitmap;

  private AnimatedImageResult(AnimatedImage paramAnimatedImage)
  {
    this.mImage = ((AnimatedImage)Preconditions.checkNotNull(paramAnimatedImage));
    this.mFrameForPreview = 0;
  }

  AnimatedImageResult(AnimatedImageResultBuilder paramAnimatedImageResultBuilder)
  {
    this.mImage = ((AnimatedImage)Preconditions.checkNotNull(paramAnimatedImageResultBuilder.getImage()));
    this.mFrameForPreview = paramAnimatedImageResultBuilder.getFrameForPreview();
    this.mPreviewBitmap = paramAnimatedImageResultBuilder.getPreviewBitmap();
    this.mDecodedFrames = paramAnimatedImageResultBuilder.getDecodedFrames();
  }

  public static AnimatedImageResult forAnimatedImage(AnimatedImage paramAnimatedImage)
  {
    return new AnimatedImageResult(paramAnimatedImage);
  }

  public static AnimatedImageResultBuilder newBuilder(AnimatedImage paramAnimatedImage)
  {
    return new AnimatedImageResultBuilder(paramAnimatedImage);
  }

  public void dispose()
  {
    try
    {
      CloseableReference.closeSafely(this.mPreviewBitmap);
      this.mPreviewBitmap = null;
      CloseableReference.closeSafely(this.mDecodedFrames);
      this.mDecodedFrames = null;
      return;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  @Nullable
  public CloseableReference<Bitmap> getDecodedFrame(int paramInt)
  {
    try
    {
      if (this.mDecodedFrames != null)
      {
        CloseableReference localCloseableReference2 = CloseableReference.cloneOrNull((CloseableReference)this.mDecodedFrames.get(paramInt));
        localCloseableReference1 = localCloseableReference2;
        return localCloseableReference1;
      }
      CloseableReference localCloseableReference1 = null;
    }
    finally
    {
    }
  }

  public int getFrameForPreview()
  {
    return this.mFrameForPreview;
  }

  public AnimatedImage getImage()
  {
    return this.mImage;
  }

  public CloseableReference<Bitmap> getPreviewBitmap()
  {
    try
    {
      CloseableReference localCloseableReference = CloseableReference.cloneOrNull(this.mPreviewBitmap);
      return localCloseableReference;
    }
    finally
    {
      localObject = finally;
      throw localObject;
    }
  }

  public boolean hasDecodedFrame(int paramInt)
  {
    try
    {
      if (this.mDecodedFrames != null)
      {
        Object localObject2 = this.mDecodedFrames.get(paramInt);
        if (localObject2 != null)
        {
          bool = true;
          return bool;
        }
      }
      boolean bool = false;
    }
    finally
    {
    }
  }
}

/* Location:           C:\Users\user\Desktop\dd28_pcdd720\classes_dex2jar.jar
 * Qualified Name:     com.facebook.imagepipeline.animated.base.AnimatedImageResult
 * JD-Core Version:    0.6.2
 */